package com.atguigu.ssyx.search.controller;

import com.atguigu.ssyx.commom.result.Result;
import com.atguigu.ssyx.search.service.SkuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZhangYK
 * @version 8.0
 * @title SkuApiController
 * @description
 * @create 2024/7/8 13:58
 */
@RestController
@RequestMapping("api/search/sku")
public class SkuApiController {
    @Resource
    private SkuService skuService;

    //上架
    @GetMapping("inner/upperSku/{skuId}")
    public Result upperSku(@PathVariable("skuId") Long skuId) {
        skuService.upperSku(skuId);
        return Result.ok(null);
    }

    //下架
    @GetMapping("inner/lowerSku/{skuId}")
    public Result lowerGoods(@PathVariable("skuId") Long skuId){
        skuService.lowerSku(skuId);
        return Result.ok(null);
    }
}
